home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 5390 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: Inter.NL.net!usenet
  2. From: Auke.Reitsma@net.HCC.nl (Auke Reitsma)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Parallel Port help
  5. Date: Mon, 12 Feb 1996 22:09:48 GMT
  6. Organization: Inter.NL.net, The Internet Provider in The Netherlands.
  7. Message-ID: <4foe2g$qm0@altrade.nijmegen.inter.nl.net>
  8. References: <4fmj1l$mro@ns2.ptd.net>
  9. Reply-To: Auke.Reitsma@net.HCC.nl
  10. NNTP-Posting-Host: rt99-18.rotterdam.nl.net
  11. X-Newsreader: Forte Free Agent 1.0.82
  12.  
  13. sound@postoffice.ptd.net (jonathan stroh) wrote:
  14.  
  15. > I need the source code to output to parallel ports.
  16. > First I would like the code for LPT1 and if possible LPT2 and LPT3
  17.  
  18. Which OS?  If good ol' MS-DOS (and reasonable compiler) just use:
  19.  
  20.     fprintf( stdprn, "This goes to %s\n", "the printer );
  21.  
  22. or something like that. Any FILE * function can use stdprn as a
  23. 'file'. 'stdprn defaults to LPT1. To use other printers use:
  24.  
  25.  
  26. int PrinterRedirect( char * FileOrDevice )
  27. {
  28.     return (NULL == freopen( FileOrDevice, "wb", stdprn));
  29. }
  30.  
  31. with either "LPT2" or "LPT3" as parameter.
  32. It also works with normal files.
  33.  
  34.  
  35. Greetings from Delft, The Netherlands.
  36.  
  37. Auke Reitsma
  38.  
  39.